<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>美图</title>
    <link rel="stylesheet" type="text/css" href="../css/amazeui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
     <link rel="stylesheet" type="text/css" href="../css/tngou.css" />
	<style>
	
	.am-menu-offcanvas1 .am-menu-nav > li > a{
	   color:#FF3333
	}
	
	</style>
</head>
<body>

 <!-- 头部 -->	
<header data-am-widget="header" id="header"
          class="am-header am-header-default am-header-fixed"  >
          <h1 class="am-header-title">美图</h1>  
          
           <nav data-am-widget="menu" class="am-menu  am-menu-offcanvas1"  data-am-menu-offcanvas> 
    <a href="javascript: void(0)" class="am-menu-toggle">
          <i class="am-menu-toggle-icon am-icon-bars"></i>
    </a>

    <div class="am-offcanvas" >
      <div class="am-offcanvas-bar  am-offcanvas-bar-flip" style="background-color: #FFFFFF;padding-top: 20px;">

      <ul class="am-menu-nav am-avg-sm-1">

          <li class="">
            <a href="JavaScript:url('http://www.tngou.net/tnfs/index/1');" class="" > 性感美女 <span class="am-fr am-icon-angle-right"></span> </a>
          </li>
          <li class="">
             <a href="JavaScript:url('http://www.tngou.net/tnfs/index/2');" class="" >日韩美女 <span class="am-fr am-icon-angle-right"></span> </a>
          </li>
           <li class="">
             <a href="JavaScript:url('http://www.tngou.net/tnfs/index/3');" class="" >美腿丝袜 <span class="am-fr am-icon-angle-right"></span> </a>
          </li>
           <li class="">
             <a href="JavaScript:url('http://www.tngou.net/tnfs/index/4');" class="" >美女照片 <span class="am-fr am-icon-angle-right"></span> </a>
          </li>
           <li class="">
             <a href="JavaScript:url('http://www.tngou.net/tnfs/index/5');" class="" >美女写真 <span class="am-fr am-icon-angle-right"></span> </a>
          </li>
           <li class="">
             <a href="JavaScript:url('http://www.tngou.net/tnfs/index/6');" class="" >清纯女孩 <span class="am-fr am-icon-angle-right"></span> </a>
          </li>
           <li class="">
             <a href="JavaScript:url('http://www.tngou.net/tnfs/index/7');" class="" >性感车模 <span class="am-fr am-icon-angle-right"></span> </a>
          </li>
      </ul>

      </div>
    </div>
  </nav>
                 
</header>


<div>
<ul class="am-avg-sm-2 am-thumbnails" id="list">
<!--  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151128/c32b2583722d43f8160fa20234c25629.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151128/527679910a2eece6dac57a4f9872fdce.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151128/26632d7e3fe906bd97af4aca64e25538.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151128/6923a849b938e32056188d0f36bbbb71.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151127/a764c8efb1bec12078087b9ef3e432fe.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151127/150107b516e31372df547ab1237f1c83.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151128/c32b2583722d43f8160fa20234c25629.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151128/527679910a2eece6dac57a4f9872fdce.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151128/26632d7e3fe906bd97af4aca64e25538.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151128/6923a849b938e32056188d0f36bbbb71.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151127/a764c8efb1bec12078087b9ef3e432fe.jpg_270x320_oc" /></li>
  <li onclick="openWin('image_show.html','image_show')"><img class="am-thumbnail" src="http://tnfs.tngou.net/image/ext/151127/150107b516e31372df547ab1237f1c83.jpg_270x320_oc" /></li>
-->
</ul>
</div>

  
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
<script type="text/javascript" src="../script/amazeui.min.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript">
    var page=1;

apiready = function(){
	page=getList(1, 'first');	// 首次加载
	// 下拉刷新
	api.setRefreshHeaderInfo({
	    visible: true,
	    bgColor: '#ccc',
	    textColor: '#fff',
	    textDown: '下拉刷新...',
	    textUp: '松开刷新...',
	    showTime: true
	}, function(ret, err){
	    //从服务器加载数据，完成后调用api.refreshHeaderLoadDone()方法恢复组件到默认状态
	    page=getList(1, 'refresh');
	});
	
	// 页面滑动到底部加载更多
	api.addEventListener({
		name:'scrolltobottom'
	},function(ret,err){		
		if(page > 1){
			page=getList(page, 'more');
		}
	    
	})	



};
    
 
 function getList(page, type){

	if(type == 'more'){
		api.showProgress({
		    style: 'default',
		    animationType: 'fade',
		    modal: false
		});
	}
	
	var html = '';	
	api.ajax({
   
		url: OpenAPI.tnfs_list,
		method: 'post',
		timeout: 30,
		dataType: 'json',
		data:{
			values: {
				dataType: 'json',
				page: page,
			},
		},
		returnAll:false,
	    
	},function(ret,err){
	    if (ret.status) {
	        var total=ret.total;
	    	var list =ret.tngou;
			  	for(var i=0;i<list.length;i++){
			  	  var tngou=list[i];
			  	   html=html+' <li onclick="url(\'http://www.tngou.net/tnfs/show/'+tngou.id+'\')"><img class="am-thumbnail" src="'+TngouImage+tngou.img+'_270x320_oc" /></li>';
			  	}
	    	
	        if(page > 1 && type=='more'){
	        	$api.append($api.dom('#list'), html);
	        }else{
	        	$api.html($api.dom('#list'), html);
	        }
	        api.parseTapmode();	        
	        if((parseInt(page)-1)*20>total)
	        {
		         api.toast({
				    msg: '数据全部加载，没有更多的数据',
				    duration:2000,
				    location: 'middle'
				});			
	        }	        
	        if(type == 'refresh'){
	        	api.refreshHeaderLoadDone();
	        }
	        

	    }else {
	        if(type == 'refresh'){
	        	api.refreshHeaderLoadDone();
	        }
			api.toast({
			    msg: '获取失败',
			    duration:2000,
			    location: 'middle'
			});
		
	    };
		api.hideProgress();
	});
	/***返回页面 */
	if(type=='more'){ return page+1;}else{return 2;}}
 
 
</script>
</html>